package com.passion.controller;

import com.alibaba.fastjson.JSONObject;
import com.passion.common.R;
import com.passion.service.OfflineAnalyseResultBarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @program offline-e-commerce-data-warehouse
 * @Description 柱状图分析结果
 * @Author limeihua
 * @Date 2024/10/02 17:15
 * @Version 1.0
 */
@RestController
@RequestMapping("/bar")
public class BarAnalyseController {
    @Autowired
    private OfflineAnalyseResultBarService offlineAnalyseResultBarService;
    /**
     *
     * @return
     */
    @PostMapping("/universalAnalyse")
    public R result(@RequestBody Map<String, Object> req) {
        JSONObject jsonObject = offlineAnalyseResultBarService.transformBarResult(req);
        return R.ok(jsonObject);
    }
}
